import pprint
from instances import instances

if __name__=='__main__':
   wordNames = {}
   for name in instances:
      words = name.encode('ascii','replace').lower().replace(',','').split('_')
      for word in words:
         if word:
            nms = wordNames.get(word, [])
            nms.append(name)
            wordNames[word] = nms
   print "names = \\"
   pprint.pprint(wordNames)
